>This distance does not have an easy explanation in terms of paths in the plane, but it still satisfies the metric space axioms. It can be thought of similarly to the number of moves a king would have to make on a chess Board game to travel from one point to another on the given space.
In fact, these three distances, while they have distinct properties, are similar in some ways. Informally, points that are close in one are close in the others, too. This observation can be quantified with the formula
which holds for every pair of points .
A radically different distance can be defined by setting
Using ,
In this discrete metric, all distinct points are 1 unit apart: none of them are close to each other, and none of them are very far away from each other either. Intuitively, the discrete metric no longer remembers that the set is a plane, but treats it just as an undifferentiated set of points.
All of these metrics make sense on as well as .
Subspaces
Given a metric space and a subset , we can consider to be a metric space by measuring distances the same way we would in . Formally, the induced metric on is a function defined by
For example, if we take the two-dimensional sphere as a subset of , the Euclidean metric on induces the straight-line metric on described above. Two more useful examples are the open interval and the closed interval thought of as subspaces of the real line.
History
Arthur Cayley, in his article "On Distance", extended metric concepts beyond Euclidean geometry into domains bounded by a conic in a projective space. His distance was given by logarithm of a cross ratio. Any projectivity leaving the conic stable also leaves the cross ratio constant, so isometries are implicit. This method provides models for elliptic geometry and hyperbolic geometry, and Felix Klein, in several publications, established the field of non-euclidean geometry through the use of the Cayley-Klein metric.
The idea of an abstract space with metric properties was addressed in 1906 by René Maurice Fréchet and the term metric space was coined by Felix Hausdorff in 1914.[F. Hausdorff (1914) Grundzuge der Mengenlehre][Mohamed A. Khamsi & William A. Kirk (2001) Introduction to Metric Spaces and Fixed Point Theory, page 14, John Wiley & Sons]
Fréchet's work laid the foundation for understanding convergence, continuity, and other key concepts in non-geometric spaces. This allowed mathematicians to study functions and sequences in a broader and more flexible way. This was important for the growing field of functional analysis. Mathematicians like Hausdorff and Stefan Banach further refined and expanded the framework of metric spaces. Hausdorff introduced topological spaces as a generalization of metric spaces. Banach's work in functional analysis heavily relied on the metric structure. Over time, metric spaces became a central part of modern mathematics. They have influenced various fields including topology, geometry, and applied mathematics. Metric spaces continue to play a crucial role in the study of abstract mathematical concepts.
Basic notions
A distance function is enough to define notions of closeness and convergence that were first developed in real analysis. Properties that depend on the structure of a metric space are referred to as metric properties. Every metric space is also a topological space, and some metric properties can also be rephrased without reference to distance in the language of topology; that is, they are really topological properties.
The topology of a metric space
For any point in a metric space and any real number , the open ball of radius around is defined to be the set of points that are strictly less than distance from :
This is a natural way to define a set of points that are relatively close to . Therefore, a set is a neighborhood of (informally, it contains all points "close enough" to ) if it contains an open ball of radius around for some .
An open set is a set which is a neighborhood of all its points. It follows that the open balls form a base for a topology on . In other words, the open sets of are exactly the unions of open balls. As in any topology, are the complements of open sets. Sets may be both open and closed as well as neither open nor closed.
This topology does not carry all the information about the metric space. For example, the distances , , and defined above all induce the same topology on , although they behave differently in many respects. Similarly, with the Euclidean metric and its subspace the interval with the induced metric are homeomorphism but have very different metric properties.
Conversely, not every topological space can be given a metric. Topological spaces which are compatible with a metric are called metrizable space and are particularly well-behaved in many ways: in particular, they are paracompact[Rudin, Mary Ellen. A new proof that metric spaces are paracompact . Proceedings of the American Mathematical Society, Vol. 20, No. 2. (Feb., 1969), p. 603.] (hence normal space) and first-countable. The Nagata–Smirnov metrization theorem gives a characterization of metrizability in terms of other topological properties, without reference to metrics.
Convergence
Convergence of sequences in Euclidean space is defined as follows:
- A sequence converges to a point if for every there is an integer such that for all , .
Convergence of sequences in a topological space is defined as follows:
- A sequence converges to a point if for every open set containing there is an integer such that for all , .
In metric spaces, both of these definitions make sense and they are equivalent. This is a general pattern for topological properties of metric spaces: while they can be defined in a purely topological way, there is often a way that uses the metric which is easier to state or more familiar from real analysis.
Completeness
Informally, a metric space is complete if it has no "missing points": every sequence that looks like it should converge to something actually converges.
To make this precise: a sequence in a metric space is Cauchy sequence if for every there is an integer such that for all , . By the triangle inequality, any convergent sequence is Cauchy: if and are both less than away from the limit, then they are less than away from each other. If the converse is true—every Cauchy sequence in converges—then is complete.
Euclidean spaces are complete, as is with the other metrics described above. Two examples of spaces which are not complete are and the rationals, each with the metric induced from . One can think of as "missing" its endpoints 0 and 1. The rationals are missing all the irrationals, since any irrational has a sequence of rationals converging to it in (for example, its successive decimal approximations). These examples show that completeness is not a topological property, since is complete but the homeomorphic space is not.
This notion of "missing points" can be made precise. In fact, every metric space has a unique completion, which is a complete space that contains the given space as a dense set subset. For example, is the completion of , and the real numbers are the completion of the rationals.
Since complete spaces are generally easier to work with, completions are important throughout mathematics. For example, in abstract algebra, the p-adic numbers are defined as the completion of the rationals under a different metric. Completion is particularly common as a tool in functional analysis. Often one has a set of nice functions and a way of measuring distances between them. Taking the completion of this metric space gives a new set of functions which may be less nice, but nevertheless useful because they behave similarly to the original nice functions in important ways. For example, to differential equations typically live in a completion (a Sobolev space) rather than the original space of nice functions for which the differential equation actually makes sense.
Bounded and totally bounded spaces
A metric space is bounded if there is an such that no pair of points in is more than distance apart. The least such is called the diameter of .
The space is called precompact or totally bounded if for every there is a finite cover of by open balls of radius . Every totally bounded space is bounded. To see this, start with a finite cover by -balls for some arbitrary . Since the subset of consisting of the centers of these balls is finite, it has finite diameter, say . By the triangle inequality, the diameter of the whole space is at most . The converse does not hold: an example of a metric space that is bounded but not totally bounded is (or any other infinite set) with the discrete metric.
Compactness
Compactness is a topological property which generalizes the properties of a closed and bounded subset of Euclidean space. There are several equivalent definitions of compactness in metric spaces:
-
A metric space is compact if every open cover has a finite subcover (the usual topological definition).
-
A metric space is compact if every sequence has a convergent subsequence. (For general topological spaces this is called sequential compactness and is not equivalent to compactness.)
-
A metric space is compact if it is complete and totally bounded. (This definition is written in terms of metric properties and does not make sense for a general topological space, but it is nevertheless topologically invariant since it is equivalent to compactness.)
One example of a compact space is the closed interval .
Compactness is important for similar reasons to completeness: it makes it easy to find limits. Another important tool is Lebesgue's number lemma, which shows that for any open cover of a compact space, every point is relatively deep inside one of the sets of the cover.
Functions between metric spaces
Unlike in the case of topological spaces or algebraic structures such as groups or rings, there is no single "right" type of morphism between metric spaces. Instead, one works with different types of functions depending on one's goals. Throughout this section, suppose that and are two metric spaces. The words "function" and "map" are used interchangeably.
Isometries
One interpretation of a "structure-preserving" map is one that fully preserves the distance function:
- A function is distance-preserving if for every pair of points and in ,
It follows from the metric space axioms that a distance-preserving function is injective. A bijective distance-preserving function is called an isometry.[.] Some authors refer to any distance-preserving function as an isometry, e.g. . One perhaps non-obvious example of an isometry between spaces described in this article is the map defined by
If there is an isometry between the spaces and , they are said to be isometric. Metric spaces that are isometric are isomorphism.
Continuous maps
On the other end of the spectrum, one can forget entirely about the metric structure and study continuous maps, which only preserve topological structure. There are several equivalent definitions of continuity for metric spaces. The most important are:
-
Topological definition. A function is continuous if for every open set in , the preimage is open.
-
Sequential continuity. A function is continuous if whenever a sequence converges to a point in , the sequence converges to the point in .
- (These first two definitions are not equivalent for all topological spaces.)
-
ε–δ definition. A function is continuous if for every point in and every there exists such that for all in we have
A homeomorphism is a continuous bijection whose inverse is also continuous; if there is a homeomorphism between and , they are said to be homeomorphic. Homeomorphic spaces are the same from the point of view of topology, but may have very different metric properties. For example, is unbounded and complete, while is bounded but not complete.
Uniformly continuous maps
A function is uniformly continuous if for every real number there exists such that for all points and in such that , we have
The only difference between this definition and the ε–δ definition of continuity is the order of quantifiers: the choice of δ must depend only on ε and not on the point . However, this subtle change makes a big difference. For example, uniformly continuous maps take Cauchy sequences in to Cauchy sequences in . In other words, uniform continuity preserves some metric properties which are not purely topological.
On the other hand, the Heine–Cantor theorem states that if is compact, then every continuous map is uniformly continuous. In other words, uniform continuity cannot distinguish any non-topological features of compact metric spaces.
Lipschitz maps and contractions
A Lipschitz map is one that stretches distances by at most a bounded factor. Formally, given a real number , the map is - Lipschitz if
Lipschitz maps are particularly important in metric geometry, since they provide more flexibility than distance-preserving maps, but still make essential use of the metric. For example, a curve in a metric space is arc length (has finite length) if and only if it has a Lipschitz reparametrization.
A 1-Lipschitz map is sometimes called a nonexpanding or metric map. Metric maps are commonly taken to be the morphisms of the category of metric spaces.
A -Lipschitz map for is called a contraction. The Banach fixed-point theorem states that if is a complete metric space, then every contraction admits a unique fixed point. If the metric space is compact, the result holds for a slightly weaker condition on : a map admits a unique fixed point if
Quasi-isometries
A quasi-isometry is a map that preserves the "large-scale structure" of a metric space. Quasi-isometries need not be continuous. For example, and its subspace are quasi-isometric, even though one is connected and the other is discrete. The equivalence relation of quasi-isometry is important in geometric group theory: the Švarc–Milnor lemma states that all spaces on which a group acts geometrically are quasi-isometric.
Formally, the map is a quasi-isometric embedding if there exist constants and such that
It is a quasi-isometry if in addition it is quasi-surjective, i.e. there is a constant such that every point in is at distance at most from some point in the image .
Notions of metric space equivalence
Given two metric spaces and :
-
They are called homeomorphic (topologically isomorphic) if there is a homeomorphism between them (i.e., a continuous bijection with a continuous inverse). If and the identity map is a homeomorphism, then and are said to be topologically equivalent.
-
They are called uniformic (uniformly isomorphic) if there is a uniform isomorphism between them (i.e., a uniformly continuous bijection with a uniformly continuous inverse).
-
They are called bilipschitz homeomorphic if there is a bilipschitz bijection between them (i.e., a Lipschitz bijection with a Lipschitz inverse).
-
They are called isometric if there is a (bijective) isometry between them. In this case, the two metric spaces are essentially identical.
-
They are called quasi-isometric if there is a quasi-isometry between them.
Metric spaces with additional structure
Normed vector spaces
A normed vector space is a vector space equipped with a norm, which is a function that measures the length of vectors. The norm of a vector is typically denoted by . Any normed vector space can be equipped with a metric in which the distance between two vectors and is given by
The metric is said to be induced by the norm . Conversely, if a metric on a vector space is
-
translation invariant: for every , , and in ; and
-
:
| d(x,y) for every and in and real number ;
then it is the metric induced by the norm
A similar relationship holds between and pseudometrics.
Among examples of metrics induced by a norm are the metrics , , and on , which are induced by the Manhattan norm, the Euclidean norm, and the maximum norm, respectively. More generally, the Kuratowski embedding allows one to see any metric space as a subspace of a normed vector space.
Infinite-dimensional normed vector spaces, particularly spaces of functions, are studied in functional analysis. Completeness is particularly important in this context: a complete normed vector space is known as a Banach space. An unusual property of normed vector spaces is that linear transformations between them are continuous if and only if they are Lipschitz. Such transformations are known as .
Length spaces
A curve in a metric space is a continuous function . The arc length of is measured by
| dt.
On a connected Riemannian manifold, one then defines the distance between two points as the infimum of lengths of smooth paths between them. This construction generalizes to other kinds of infinitesimal metrics on manifolds, such as sub-Riemannian and Finsler manifold.
The Riemannian metric is uniquely determined by the distance function; this means that in principle, all information about a Riemannian manifold can be recovered from its distance function. One direction in metric geometry is finding purely metric ("synthetic") formulations of properties of Riemannian manifolds. For example, a Riemannian manifold is a space (a synthetic condition which depends purely on the metric) if and only if its sectional curvature is bounded above by . Thus spaces generalize upper curvature bounds to general metric spaces.
Metric measure spaces
Real analysis makes use of both the metric on \R^n and the Lebesgue measure. Therefore, generalizations of many ideas from analysis naturally reside in metric measure spaces: spaces that have both a measure and a metric which are compatible with each other. Formally, a metric measure space is a metric space equipped with a Borel regular measure such that every ball has positive measure. For example Euclidean spaces of dimension , and more generally -dimensional Riemannian manifolds, naturally have the structure of a metric measure space, equipped with the Lebesgue measure. Certain fractal metric spaces such as the Sierpiński gasket can be equipped with the α-dimensional Hausdorff measure where α is the Hausdorff dimension. In general, however, a metric space may not have an "obvious" choice of measure.
One application of metric measure spaces is generalizing the notion of Ricci curvature beyond Riemannian manifolds. Just as and generalize sectional curvature bounds, are a class of metric measure spaces which generalize lower bounds on Ricci curvature.
Further examples and applications
Graphs and finite metric spaces
A if its induced topology is the discrete topology. Although many concepts, such as completeness and compactness, are not interesting for such spaces, they are nevertheless an object of study in several branches of mathematics. In particular, (those having a finite set number of points) are studied in combinatorics and theoretical computer science. Embeddings in other metric spaces are particularly well-studied. For example, not every finite metric space can be isometry in a Euclidean space or in Hilbert space. On the other hand, in the worst case the required distortion (bilipschitz constant) is only logarithmic in the number of points.[Jiří Matoušek and Assaf Naor, ed. "Open problems on embeddings of finite metric spaces". .]
For any undirected connected graph , the set of vertices of can be turned into a metric space by defining the distance between vertices and to be the length of the shortest edge path connecting them. This is also called shortest-path distance or geodesic distance. In geometric group theory this construction is applied to the Cayley graph of a (typically infinite) finitely-generated group, yielding the word metric. Up to a bilipschitz homeomorphism, the word metric depends only on the group and not on the chosen finite generating set.
Metric embeddings and approximations
An important area of study in finite metric spaces is the embedding of complex metric spaces into simpler ones while controlling the distortion of distances. This is particularly useful in computer science and discrete mathematics, where algorithms often perform more efficiently on simpler structures like tree metrics.
A significant result in this area is that any finite metric space can be probabilistically embedded into a tree metric with an expected distortion of O(log n), where n is the number of points in the metric space.
This embedding is notable because it achieves the best possible asymptotic bound on distortion, matching the lower bound of \Omega(log n). The tree metrics produced in this embedding dominate the original metrics, meaning that distances in the tree are greater than or equal to those in the original space. This property is particularly useful for designing approximation algorithms, as it allows for the preservation of distance-related properties while simplifying the underlying structure.
The result has significant implications for various computational problems:
-
Network design: Improves approximation algorithms for problems like the Group Steiner tree problem (a generalization of the Steiner tree problem) and Buy-at-bulk network design (a problem in Network planning and design) by simplifying the metric space to a tree metric.
-
Clustering: Enhances algorithms for clustering problems where hierarchical clustering can be performed more efficiently on tree metrics.
-
Online algorithms: Benefits problems like the k-server problem and metrical task system by providing better competitive ratios through simplified metrics.
The technique involves constructing a hierarchical decomposition of the original metric space and converting it into a tree metric via a randomized algorithm. The O(log n) distortion bound has led to improved approximation ratios in several algorithmic problems, demonstrating the practical significance of this theoretical result.
Distances between mathematical objects
In modern mathematics, one often studies spaces whose points are themselves mathematical objects. A distance function on such a space generally aims to measure the dissimilarity between two objects. Here are some examples:
-
Functions to a metric space. If is any set and is a metric space, then the set of all f \colon X \to M (i.e. those functions whose image is a bounded subset of M) can be turned into a metric space by defining the distance between two bounded functions and to be d(f,g) = \sup_{x \in X} d(f(x),g(x)). This metric is called the uniform metric or supremum metric. If is complete, then this function space is complete as well; moreover, if is also a topological space, then the subspace consisting of all bounded continuous functions from to is also complete. When is a subspace of \R^n, this function space is known as a classical Wiener space.
-
and . There are many ways of measuring distances between strings of characters, which may represent sentences in computational linguistics or code words in coding theory. Edit distances attempt to measure the number of changes necessary to get from one string to another. For example, the Hamming distance measures the minimal number of substitutions needed, while the Levenshtein distance measures the minimal number of deletions, insertions, and substitutions; both of these can be thought of as distances in an appropriate graph.
-
Graph edit distance is a measure of dissimilarity between two graphs, defined as the minimal number of Graph operations required to transform one graph into another.
-
Wasserstein metrics measure the distance between two measures on the same metric space. The Wasserstein distance between two measures is, roughly speaking, the cost of transporting one to the other.
-
The set of all by matrices over some field is a metric space with respect to the rank distance d(A,B) = \mathrm{rank}(B - A).
-
The Helly metric in game theory measures the difference between strategies in a game.
Hausdorff and Gromov–Hausdorff distance
The idea of spaces of mathematical objects can also be applied to subsets of a metric space, as well as metric spaces themselves. Hausdorff and Gromov–Hausdorff distance define metrics on the set of compact subsets of a metric space and the set of compact metric spaces, respectively.
Suppose is a metric space, and let be a subset of . The distance from to a point of is, informally, the distance from to the closest point of . However, since there may not be a single closest point, it is defined via an infimum:
d(x,S) = \inf\{d(x,s) : s \in S \}.
In particular, d(x, S)=0 if and only if belongs to the closure of . Furthermore, distances between points and sets satisfy a version of the triangle inequality:
d(x,S) \leq d(x,y) + d(y,S),
and therefore the map d_S:M \to \R defined by d_S(x)=d(x,S) is continuous. Incidentally, this shows that metric spaces are completely regular.
Given two subsets and of , their Hausdorff distance is
d_H(S,T) = \max \{ \sup\{d(s,T) : s \in S \} , \sup\{ d(t,S) : t \in T \} \}.
Informally, two sets and are close to each other in the Hausdorff distance if no element of is too far from and vice versa. For example, if is an open set in Euclidean space is an Delone set inside , then d_H(S,T)<\varepsilon. In general, the Hausdorff distance d_H(S,T) can be infinite or zero. However, the Hausdorff distance between two distinct compact sets is always positive and finite. Thus the Hausdorff distance defines a metric on the set of compact subsets of .
The Gromov–Hausdorff metric defines a distance between (isometry classes of) compact metric spaces. The Gromov–Hausdorff distance between compact spaces and is the infimum of the Hausdorff distance over all metric spaces that contain and as subspaces. While the exact value of the Gromov–Hausdorff distance is rarely useful to know, the resulting topology has found many applications.
Miscellaneous examples
-
Given a metric space and an increasing concave function f \colon [0,\infty) \to [0,\infty) such that if and only if , then d_f(x,y)=f(d(x,y)) is also a metric on . If for some real number , such a metric is known as a snowflake of .
-
The tight span of a metric space is another metric space which can be thought of as an abstract version of the convex hull.
-
The knight's move metric, the minimal number of knight's moves to reach one point in \mathbb{Z}^2 from another, is a metric on \mathbb{Z}^2.
-
The British Rail metric (also called the "post office metric" or the "French railway metric") on a normed vector space is given by d(x,y) = \lVert x \rVert + \lVert y \rVert for distinct points x and y, and d(x,x) = 0. More generally \lVert \cdot \rVert can be replaced with a function f taking an arbitrary set S to non-negative reals and taking the value 0 at most once: then the metric is defined on S by d(x,y) = f(x) + f(y) for distinct points x and y, and The name alludes to the tendency of railway journeys to proceed via London (or Paris) irrespective of their final destination.
-
The Robinson–Foulds metric used for calculating the distances between Phylogenetic trees in Phylogenetics
Constructions
Product metric spaces
If (M_1,d_1),\ldots,(M_n,d_n) are metric spaces, and is the Euclidean norm on \mathbb R^n, then \bigl(M_1 \times \cdots \times M_n, d_\times\bigr) is a metric space, where the product metric is defined by
d_\times\bigl((x_1,\ldots,x_n),(y_1,\ldots,y_n)\bigr) = N\bigl(d_1(x_1,y_1),\ldots,d_n(x_n,y_n)\bigr),
and the induced topology agrees with the product topology. By the equivalence of norms in finite dimensions, a topologically equivalent metric is obtained if is the taxicab norm, a p-norm, the maximum norm, or any other norm which is non-decreasing as the coordinates of a positive -tuple increase (yielding the triangle inequality).
Similarly, a metric on the topological product of countably many metric spaces can be obtained using the metric
d(x,y)=\sum_{i=1}^\infty \frac1{2^i}\frac{d_i(x_i,y_i)}{1+d_i(x_i,y_i)}.
The topological product of uncountably many metric spaces need not be metrizable. For example, an uncountable product of copies of \mathbb{R} is not first-countable and thus is not metrizable.
Quotient metric spaces
If is a metric space with metric , and \sim is an equivalence relation on , then we can endow the quotient set M/\!\sim with a pseudometric. The distance between two equivalence classes x and y is defined as
d'(x,y) = \inf\{d(p_1,q_1)+d(p_2,q_2)+\dotsb+d(p_{n},q_{n})\},
where the infimum is taken over all finite sequences (p_1, p_2, \dots, p_n) and (q_1, q_2, \dots, q_n) with p_1 \sim x, q_n \sim y, q_i \sim p_{i+1}, i=1,2,\dots, n-1. In general this will only define a pseudometric, i.e. d'(x,y)=0 does not necessarily imply that x=y. However, for some equivalence relations (e.g., those given by gluing together polyhedra along faces), d' is a metric.
The quotient metric d' is characterized by the following universal property. If f\,\colon(M,d)\to(X,\delta) is a metric (i.e. 1-Lipschitz) map between metric spaces satisfying whenever x \sim y, then the induced function \overline{f}\,\colon {M/\sim}\to X, given by \overline{f}(x)=f(x), is a metric map \overline{f}\,\colon (M/\sim,d')\to (X,\delta).
The quotient metric does not always induce the quotient topology. For example, the topological quotient of the metric space \N \times 0,1 identifying all points of the form (n, 0) is not metrizable since it is not first-countable, but the quotient metric is a well-defined metric on the same set which induces a coarser topology. Moreover, different metrics on the original topological space (a disjoint union of countably many intervals) lead to different topologies on the quotient.[See , although in this book the quotient \N \times 0,1/\N \times \{0\} is incorrectly claimed to be homeomorphic to the topological quotient.]
A topological space is sequential space if and only if it is a (topological) quotient of a metric space.[Goreham, Anthony. Sequential convergence in Topological Spaces . Honours' Dissertation, Queen's College, Oxford (April, 2001), p. 14]
Generalizations of metric spaces
There are several notions of spaces which have less structure than a metric space, but more than a topological space.
-
are spaces in which distances are not defined, but uniform continuity is.
-
are spaces in which point-to-set distances are defined, instead of point-to-point distances. They have particularly good properties from the point of view of category theory.
-
are a generalization of metric spaces and that can be used to unify the notions of metric spaces and Domain theory.
There are also numerous ways of relaxing the axioms for a metric, giving rise to various notions of generalized metric spaces. These generalizations can also be combined. The terminology used to describe them is not completely standardized. Most notably, in functional analysis pseudometrics often come from on vector spaces, and so it is natural to call them "semimetrics". This conflicts with the use of the term in topology.
Extended metrics
Some authors define metrics so as to allow the distance function to attain the value ∞, i.e. distances are non-negative numbers on the extended real number line. Such a function is also called an extended metric or "∞-metric". Every extended metric can be replaced by a real-valued metric that is topologically equivalent. This can be done using a subadditive monotonically increasing bounded function which is zero at zero, e.g. d'(x, y) = d(x, y) / (1 + d(x, y)) or d''(x, y) = \min(1, d(x, y)).
Metrics valued in structures other than the real numbers
The requirement that the metric take values in [0,\infty) can be relaxed to consider metrics with values in other structures, including:
-
, yielding the notion of a generalised metric.
-
More general . In the absence of an addition operation, the triangle inequality does not make sense and is replaced with an ultrametric inequality. This leads to the notion of a generalized ultrametric.
These generalizations still induce a uniform space on the space.
Pseudometrics
A pseudometric on X is a function d: X \times X \to \R which satisfies the axioms for a metric, except that instead of the second (identity of indiscernibles) only d(x,x)=0 for all x is required. In other words, the axioms for a pseudometric are:
-
d(x, y) \geq 0
-
d(x,x)=0
-
d(x,y)=d(y,x)
-
d(x,z)\leq d(x,y) + d(y,z).
In some contexts, pseudometrics are referred to as semimetrics because of their relation to .
Quasimetrics
Occasionally, a quasimetric is defined as a function that satisfies all axioms for a metric with the possible exception of symmetry.[; ] The name of this generalisation is not entirely standardized.[ calls them "semimetrics". That same term is also frequently used for two other generalizations of metrics.]
-
d(x, y) \geq 0
-
d(x,y)=0 \iff x=y
-
d(x,z) \leq d(x,y) + d(y,z)
Quasimetrics are common in real life. For example, given a set of mountain villages, the typical walking times between elements of form a quasimetric because travel uphill takes longer than travel downhill. Another example is the taxicab geometry in a city with one-way streets: here, a shortest path from point to point goes along a different set of streets than a shortest path from to and may have a different length.
A quasimetric on the reals can be defined by setting
d(x,y)=\begin{cases}
x-y & \text{if }x\geq y,\\
1 & \text{otherwise.}
\end{cases}
The 1 may be replaced, for example, by infinity or by 1 + \sqrt{y-x} or any other subadditivity function of . This quasimetric describes the cost of modifying a metal stick: it is easy to reduce its size by filing it down, but it is difficult or impossible to grow it.
Given a quasimetric on , one can define an -ball around to be the set \{y \in X | d(x,y) \leq R\}. As in the case of a metric, such balls form a basis for a topology on , but this topology need not be metrizable. For example, the topology induced by the quasimetric on the reals described above is the (reversed) Sorgenfrey line.
Metametrics or partial metrics
In a metametric, all the axioms of a metric are satisfied except that the distance between identical points is not necessarily zero. In other words, the axioms for a metametric are:
-
d(x,y)\geq 0
-
d(x,y)=0 \implies x=y
-
d(x,y)=d(y,x)
-
d(x,z)\leq d(x,y)+d(y,z).
Metametrics appear in the study of Gromov hyperbolic metric spaces and their boundaries. The visual metametric on such a space satisfies d(x,x)=0 for points x on the boundary, but otherwise d(x,x) is approximately the distance from x to the boundary. Metametrics were first defined by Jussi Väisälä. In other work, a function satisfying these axioms is called a partial metric or a dislocated metric.
Semimetrics
A semimetric on X is a function d: X \times X \to \R that satisfies the first three axioms, but not necessarily the triangle inequality:
-
d(x,y)\geq 0
-
d(x,y)=0 \iff x=y
-
d(x,y)=d(y,x)
Some authors work with a weaker form of the triangle inequality, such as:
- {
|
| d(x,z)\leq \rho\,(d(x,y)+d(y,z)) | ρ-relaxed triangle inequality |